<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

//登录
Route::post('/login', 'User\UserController@login');
//注册
//Route::post('/register', 'Admin\RegisterController@register');

Route::group(['middleware' => 'checkLogin'], function(){
    //登出
    Route::post('/logout', 'User\UserController@logOut');
    //注册
    Route::post('/register', 'Admin\RegisterController@register');
    //用户列表
    Route::get('/user/list', 'User\UserController@getUserList');
    //设置用户权限
    Route::put('/user/set/roles/{user}', 'User\UserController@setUserRoles');
    //管理员重置用户密码
    Route::put('/reset/password/{user}', 'User\UserController@reSetPassWord');

    //提交订单
    Route::post('/order/create', 'Order\OrderController@createOrder');
    //订单列表
    Route::get('/order/list', 'Order\OrderController@getOrderList');
    //查看单个订单信息
    Route::get('/order/info/{order}', 'Order\OrderController@getOrderInfo');
    //更新订单信息
    Route::put('/order/update/{order}', 'Order\OrderController@updateOrder');
    //删除订单
    Route::delete('/order/remove/{order}', 'Order\OrderController@removeOrder');
    //服务商确认
    Route::put('/order/service/confirm/{order}', 'Order\OrderController@serviceConfirm');
    //服务商填写信息
    Route::put('/order/supply/info/{order}', 'Order\OrderController@supplyOrderInfo');
    //查看已删除订单
    Route::get('/order/remove/list', 'Order\OrderController@getRemoveOrderList');

    Route::group(['middleware' => 'checkAdmin'], function(){
        Route::any('/test', 'Order\OrderController@test');
    });
});



